home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_gen_slashweb.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  97 lines

  1. # Jones 3D Cog Script
  2. #
  3. # gen_SlashWeb.cog
  4. #
  5. # Damage no move web with Machete to allow move through. 
  6. # Use gen_a4web.mat
  7. #
  8. # [TRM]
  9. #
  10. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  11. # ========================================================================================
  12.  
  13. symbols
  14.     
  15.     message     activated
  16.     message     damaged
  17.     
  18.     thing       player                          local
  19.     thing       burnPos                         local
  20.     
  21.     surface     web                                mask=0x408
  22.     surface        webback                            mask=0x408
  23.     
  24.     template    smoke=dustcloud                 local
  25.     
  26.     material    dustMat=gen_a4sfx_dustcloud.mat    local
  27.     
  28.     sound       lightWeb=gen_torchlitet_c.wav    local
  29.     
  30.     vector      smokeStart                      local
  31.     vector      smokeEnd                        local
  32.     
  33.     int         isBurnt=0                       local
  34.  
  35.     # Subroutines
  36.     flex        RemoveWeb                        local
  37.     
  38. end
  39.  
  40. # ========================================================================================
  41.  
  42. code
  43.  
  44. activated:
  45.  
  46.     if(isBurnt == 1) return;
  47.  
  48.     isBurnt = 1;
  49.     
  50.     player = GetLocalPlayerThing();
  51.     smokeStart = VectorSet(0.2, 0.2, 0.5);
  52.     smokeEnd = VectorSet(1.0, 1.0, 0.0);
  53.     
  54.     PlayMode(player, 60, 0);
  55.     Sleep(0.3);
  56.     
  57.     burnPos = CreateThingAtPos(smoke, GetSurfaceSector(web), GetSurfaceCenter(web), '0.0 0.0 0.0');
  58.     CaptureThing(burnPos);
  59.     
  60.     PlaySoundThing(lightWeb, burnPos, 1.0, 5.0, 10.0, 0);
  61.  
  62.     # alter adjoin
  63.     call RemoveWeb;
  64.     
  65.     # animate smoke
  66.     SetMaterialCel(dustMat, 0);
  67.     MaterialAnim(dustMat, 4.0, 1);
  68.     AnimateSpriteSize(burnPos, smokeStart, smokeEnd, 2.0);
  69.     
  70.     return;
  71.  
  72. # ========================================================================================
  73.  
  74. damaged:
  75.  
  76.     # See if damage is from machete -- RT
  77.     if (GetParam(1) == 0x20)
  78.     {
  79.         call RemoveWeb;
  80.     }
  81.         
  82.     return;
  83.  
  84. # ========================================================================================
  85.  
  86. RemoveWeb:
  87.  
  88.     SetWallCel(web, 1);
  89.     SetWallCel(webback, 1);
  90.     ClearAdjoinFlags(web, 0x10);     # Clear no player move flag
  91.     SetAdjoinflags(webback, 0x2);    # Set move flag
  92.     
  93.     return;
  94.  
  95. end
  96.  
  97.